package com.szm.feignserver.webui;

import com.szm.feignserver.entity.UserProduct;
import com.szm.feignserver.service.ProductService;
import com.szm.feignserver.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserProductController {

    @Autowired
    private UserService userService;
    @Autowired
    private ProductService productService;

    @RequestMapping("/getuserproductfeign")
    public UserProduct getUserProduct(){
        UserProduct userProduct=new UserProduct();
        userProduct.setUser(userService.getUser());
        userProduct.setProduct(productService.getProduct());
        return userProduct;
    }
}
